import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import router from './router'
//import 'amfe-flexible'
import 'element-plus/dist/index.css'
import './style.css'
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
// @ts-ignore
import locale from 'element-plus/dist/locale/zh-cn'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(pinia)
app.use(router)
app.use(ElementPlus, {
    locale,
});
/*
app.config.errorHandler = (err) => {
    if (err.message.includes("JSON.parse")) {
        console.warn("忽略 JSON 解析错误");
        return;
    }
    // 处理其他错误
};
*/
app.mount('#app')
